#pragma once
#include <QApplication>
#include <QMessageBox>
#include "Document.h"
#include "PluginManager.h"
#include "dynamic_common_global.h"

/// @note QApplication is for GUI, QCoreApplication is for command line stuff
class DYNAMIC_COMMON_EXPORT StarlabApplication : public QApplication{
public:
    /// Load the plugins on creation
    PluginManager plugins;
    /// The set of loaded models
    Document document;
    
    /// Constructor
    StarlabApplication(int &argc, char* argv[]);
    
    /// @todo what is this?
    bool notify( QObject * rec, QEvent * ev );
    
public:
    /// @return false if don't know (missing plugin?) how to load
    bool load(QString path);

    /// @{
        bool loadModel(QString path, InputOutputPlugin *plugin);
        bool saveModel(Model* model, QString path="");
    /// @}

    bool loadProject(QString path, ProjectInputOutputPlugin *plugin);
    
    
    void executeFilter(QString filterName);
};
